import { PropsWithChildren } from 'react';
import styles from './index.less';

interface CardPanelProps extends PropsWithChildren {
  title: string;
  right?: React.ReactNode;
  style?: React.CSSProperties;
}
const CardPanel = (props: CardPanelProps) => {
  const { title, right, children, style } = props;
  return (
    <div className={styles.cardPanel} style={style}>
      <aside className={styles.cardPanelTitle}>{title}</aside>
      <section className={styles.cardPanelContent}>{children}</section>
      {right}
    </div>
  );
};

export default CardPanel;
